package com.bestbuy.pojo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

/**
 * @author ThanhNgo
 * 
 */
@Entity
@Table(name = "comment")
public class Comment {
	@Id
	@Column(name = "IDCOMMENT")
	@GeneratedValue
    private Integer idcomment;
	
	@ManyToOne
    @JoinColumn(name="IDPRODUCT")
	@Fetch(FetchMode.JOIN)
    private Product product;
    
	@ManyToOne
    @JoinColumn(name="IDACCOUNT")
	@Fetch(FetchMode.JOIN)
    private Account account;
    
    @Column(name = "DATECREATED")
    private String datecreated;
    
    @Column(name = "TEXT")
    private String text;
    
    @Column(name = "ISDELETED")
    private Integer isdeleted;

	public Integer getIdcomment() {
		return idcomment;
	}

	public void setIdcomment(Integer idcomment) {
		this.idcomment = idcomment;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public String getDatecreated() {
		return datecreated;
	}

	public void setDatecreated(String datecreated) {
		this.datecreated = datecreated;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public Integer getIsdeleted() {
		return isdeleted;
	}

	public void setIsdeleted(Integer isdeleted) {
		this.isdeleted = isdeleted;
	}

	public Comment(Integer idcomment, Product product, Account account,
			String datecreated, String text, Integer isdeleted) {
		super();
		this.idcomment = idcomment;
		this.product = product;
		this.account = account;
		this.datecreated = datecreated;
		this.text = text;
		this.isdeleted = isdeleted;
	}

	public Comment() {
		super();
		// TODO Auto-generated constructor stub
	}
    
    
}
